From b5ac277654ffe97df5e8a9383527a34238248059 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 24 Sep 2017 21:34:53 -0400 Subject: [PATCH] Plug a memory leak A function with ensure in the name would better check if the thing it is supposed to ensure already exists. --- gsk/gskvulkanimage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gsk/gskvulkanimage.c b/gsk/gskvulkanimage.c index 2540d8a58c..d09a109e52 100644 --- a/gsk/gskvulkanimage.c +++ b/gsk/gskvulkanimage.c @@ -299,7 +299,8 @@ static void gsk_vulkan_image_ensure_view (GskVulkanImage *self, VkFormat format) { - GSK_VK_CHECK (vkCreateImageView, gdk_vulkan_context_get_device (self->vulkan), + if (self->vk_image_view == VK_NULL_HANDLE) + GSK_VK_CHECK (vkCreateImageView, gdk_vulkan_context_get_device (self->vulkan), &(VkImageViewCreateInfo) { .sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO, .image = self->vk_image, -- 2.30.2